Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
angular e2e tests - json object forEach method used in data driven tests throw "not a function error"

Have a data.json file and trying to use json data in e2e tests as given in below example. https://www.c-sharpcorner.com/article/data-driven-testing-in-protractor/

The example works fine with github version. Same implementation throw below error with Angular 12 and latest version. It seems the typescript version is unable to recognize the data object as array type. Not sure where to look at. Any help on this is apprecicated.

  • TypeError: calcJson.forEach is not a function

Below is the tsconfig setting:

"compilerOptions": { "baseUrl": "./", "downlevelIteration": true, "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "module": "es2020", "moduleResolution": "node", "experimentalDecorators": true, "importHelpers": true, "target": "es2015", "resolveJsonModule": true, "esModuleInterop": true, "typeRoots": [ "node_modules/@types" ], "lib": [ "es2018", "dom" ],

Package.json file:

"@angular-devkit/build-angular": "~12.2.7", "@angular/cli": "~12.2.7", "@angular/compiler-cli": "~12.2.7", "@angular/language-service": "~12.2.7", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "concat": "^1.0.3", "fs-extra": "^8.1.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "mini-css-extract-plugin": "^2.3.0", "protractor": "~7.0.0", "protractor-beautiful-reporter": "^1.3.6", "ts-node": "~7.0.0", "tslint": "~6.1.0", "typescript": "~4.3.5"

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!